/**
* @file 审批底部组件
* @author renzhiqiang
* @date 2017-01-07
*/
<template>
  <div class="mui-bar mui-bar-nav approveBnt" v-show="configure.show">
    <div style="height:40px;">
      <div>
        <p class="approves" :style="{width: width + '%' }" @tap='switch($index,obj)' v-for="obj in configure.ele"  v-bind:class="obj.class">
          {{obj.text}}
        </p>
      </div>
    </div>
  </div>
</template>
<style lang="less" rel="stylesheet/less">
  @import 'approve.css';
</style>
<script>
  export default{
    props: {
      configure: {} //组件配置属性
    },
    methods: {
      switch: function (evt, data) {
        if(typeof this.configure.ele[evt].fn === 'function' ){
          this.configure.ele[evt].fn.bind(this)(evt, data);
        }
      }
    },
    computed: {
      width: function () { // 面积等分
        return 100 / this.configure.ele.length;
      }
    }
  }
</script>
